package 每日一题;

import java.util.*;

public class 第k个最小的素数分数 {
    public int[] kthSmallestPrimeFraction(int[] arr, int k) {
        List<Double> list = new ArrayList<>();
        HashMap<Double, int[]> map = new HashMap<>();
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {
                double tem =(double)arr[i] / arr[j];
                list.add(tem);
                map.put(tem,new int[]{arr[i],arr[j]});
            }
        }
        Collections.sort(list);
        Double res = list.get(k);
        return map.get(res);
    }
}
